
              @@    @@ @@@@@ @@@@@  @@@@@@@@ @@@@@ @@   @@
              @@    @@ @@    @@  @@    @@    @@     @@ @@
               @@  @@  @@@@  @@@@@     @@    @@@@    @@@
                @@@@   @@    @@ @@     @@    @@     @@ @@
                 @@    @@@@@ @@  @@    @@    @@@@@ @@   @@ 

               @@@@ @@  @@ @@    @@ @@@@@   @@@@  @@   @@
              @@    @@ @@   @@  @@  @@  @@ @@  @@  @@ @@
               @@@  @@@@     @@@@   @@@@@  @@  @@   @@@
                 @@ @@ @@     @@    @@  @@ @@  @@  @@ @@
              @@@@  @@  @@    @@    @@@@@   @@@@  @@   @@

 	         @@@@@ @@@@@  @@ @@@@@@@@  @@@@  @@@@@  
                 @@    @@  @@ @@    @@    @@  @@ @@  @@ 
                 @@@@  @@  @@ @@    @@    @@  @@ @@@@@  
                 @@    @@  @@ @@    @@    @@  @@ @@ @@  
                 @@@@@ @@@@@  @@    @@     @@@@  @@  @@

				V.1.0

      Created by Rune Andreas Fjr a.k.a. Rubbberrabbbit2/Greenblizzard

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


This is a tool for creating and editing vertex color based 3d model skyboxes
such as those found in the original PsOne Spyro games. The key premise is
that all vertices are locked to the surface of a sphere.

Please note, this is only the first released version,  it's not completely
bug free, and it lacks a few features that I want to include. For instance,
imported skies where vertices of different colour have the exact same
coordinate, such as the crystals in a few Spyro skies, they are combined into
one vertex upon loading, which they shouldn't be.
It's also my intention to make an option to export skies in the Spyro format
to put them back into the game.


A big thanks to LxShadow and Kly_Men_COmpany for their work on the Spyro
sky model formats, on which I've based my Spyro sky import code.


You are free to redistribute this program non-commercially as long as you
include this text file. Happy editing!



!!! Important!!!
	Certain machines may have trouble displaying the graphics properly,
	and in this case, you should run 
		Vertex Skybox Editor SoftVertProcessing.exe
	rather than 
		Vertex Skybox Editor.exe

!!! Important!!!
	Keep the editor executable in a folder named Vertex Skybox Editor - 
	otherwise it will save all files to this location 

	C:/Users/*user*/AppData/Local/Vertex Skybox Editor/

	which is also where the autosave file is stored.


!!! Important!!!
	Your antivirus software may not like this program - mine hates it,
	but it's not malware, and not a virus or a trojan.

	Also, this program is created with GameMaker:Studio, and because of a
	lot of malware prank programs created with older versions of the game
	engine, GM:Studio games(or applications like this) are often
	associated by anti virus software as security risks despite the fact
	that GM:Studio strictly limit creations to a safe, sandboxed
	environment.


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

				Table of Contents:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


	Usage Tips

		Creating long, narrow clouds
		When importing Spyro skies with stars
		Combining sky models
		When editing multi-layer skies
		Importing into other 3D engines
		If the editor crashes


	General GUI buttons or elements:

		New Sky
		Save Sky
		Load Sky
		Export Sky
		Import Spyro Sky
		Palette
		Brush Radius
		Display
		Selection
		Copy Paste
		Camera Position
		Layer Up/Down
		Load Autosave
		Fix Errors
		Undo/Redo


	Tools & Brushes:
	
		Colour Manipulation
		Paint Brush
		Pipette
		Gradient
		Create Brush
		Edge Flip
		Triangle fill
		Triangle Autofill Brush
		Beautify Brush
		Delete Brush
		Edge Collapse
		Grab Brush
		Select or Transform: Move
		Select or Transform: Rotate
		Select or Transform: Scale
		Pipette select
		Selection Group Brush
		Sketch Pencil


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

				Usage Tips:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


Creating long, narrow clouds:
	First create less narrow clouds, and then scale them down on the
	vertical axis.


When importing Spyro skies with stars:
	It can be difficult to work with a sky where both the sky and stars
	are in the same layer, so:
	1) Select a vertex that is part of the main mesh.
	2) Move to a higher layer, deselect.
	Your stars (and eventual planets) are now on the center layer, while
	the main sky mesh is on a higher layer further back.


Combining sky models:
	1) Compress your sky into a single layer and copy it.
	2) Load or import a different sky.
	3) Paste your original sky layer and re-organize it back into
	the layers you had.


When editing multi-layer skies:
	Position the camera at the center of the sphere to see the sky as it
	will appear in-game, without the parallax effect of separated layers.


Importing into other 3D engines:
	Using code, .obj is probably the easiest of the export formats to read,
	other than .d3d.	

	While Blender won't import the vertex colours of an .obj file, you
	can import a .ply file instead.

	Unity 3D can import and display .fbx files, if you have a shader to
	display the vertex colours. Like this one: http://forum.unity3d.com/threads/standard-shader-with-vertex-colors.316529/

	If you just want the visual appearance, a texture image (cubemap)
	is even more universally supported. The drawback is a monstrously
	bigger file size.


If the editor crashes:
	Run it again and press the Load Autosave button. Hopefully you won't
	have lost too much. Then press the Error fix button in case the cause
	of the crash was a corrupted mesh. This might fix the issue.


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

			     General GUI buttons:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
	
	
	New Sky:
		Creates a new blank sphere, erasing all other geometry.


	Save Sky:
		Saves the skybox to a .skye file.

	
	Load Sky:
		Loads a skybox from a .skye file.


	Export Sky:
		Exports the sky to one of these formats

			-Wavefront(.obj) - a common 3d model format, though
			rarely supported with vertex colours.

			-GameMaker model(.d3d) GameMaker's standard 3d model
			format
			
			-Stanford(.ply) - a common 3d model format with vertex
			colour support. Can be imported with vertex colours in
			Blender.

			-Autodesk FBX(.fbx) - Can be imported with vertex
			colour in Unity, though you need a shader to display it
			properly: http://forum.unity3d.com/threads/standard-shader-with-vertex-colors.316529/
			
			-PNG panorama image(.png) - what it sounds like
			
			-PNG cubemap texture(.png) - A cubemap texture with
			side dimensions 1048x1048 to display the sky as a
			texture on a cube rather than a vertex colored sphere.
		
		
	Import Spyro Sky:
		Imports a Sky.sky file ripped from the Spyro games with SpyroEdit.
		
	
	Palette:
		The palette has 40 colour slots. The left and right mouse buttons
		can be assigned to a slot by left- or right-clicking.
		The colour of the most recently selected slot can be edited with
		the rainbow and saturation/brightness tool.
		Mouse button colour opacity can be adjusted with a pair of sliders.


	Brush radius increment and decrement buttons:
		Do what they sound like, when you hold the left button pressed
		on them.


	Display buttons: 
		Toggles on/off the visibility of these various elements
			-Triangles
			-Edges
			-Vertices
			-Selection
			-Axis cross
			-Layers
			-Sketch

	
	The Selection Menu gives a few options for vertex selection in the
	current layer:
			-Select all      	Ctrl A
			-Deselect all    	Ctrl A
			-Select more     	Numpad +
			-Select less     	Numpad -
			-Select linked   	Ctrl L
			-Select inverse  	Ctrl I


	Copy & Paste buttons:
		Copies the selected geometry to the clipboard, or pastes
		geometry from the clipboard to the current layer.
		Shortcuts: Ctrl C and Ctrl V

	
	Camera Position Menu:
		Gives a few options for aligning the camera in key positons.

	
	Layer Up/Down buttons:
		Moves the selected vertices(and all those connected to them),
		if any, to a higher or lower layer, also shifting the
		editor's focus to that layer. There are six layers in total.


	Load Autosave button:
		Loads the last autosave. Useful in case the editor program
		crashes on you and you haven't saved in a while. A new
		autosave is made every 10th undo worthy action.


	Fix Errors button:
		The editor is not completely bug free, so in a few cases, the
		geometry editing tools ends up corrupting the data. This button
		looks for and solves a few known issues. Doing this can help
		save your sky. It also flips triangles that are facing the
		wrong way(outwards).

	
	Set Background Colour:
		Visible when the Paint Brush, Pipette, Gradient or Create
		Brush is selected. Sets the background colour to the left
		button colour


	Palette from sky:
		Visible when the Paint Brush, Pipette, Gradient or Create
		Brush is selected. Sets the background colour to the left
		button colour

	Undo/Redo:
		Undo or redo actions.
		The undo stack is unlimited(or at least until the program
		crashes from lack of memory), while the redo stack is
		discarded once you make an undo worthy action.
	

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                 
				    Tools & Brushes:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


Colour Manipulation
	A range of sliders to manipulate the colours of the selection or
	layer.

Paint Brush
	Obviously used for painting vertices. Both the left and right mouse
	button can be used, and each have their own adjustable colour and
	opacity.


Pipette
	Samples colour from the scene at the mouse cursor position, assigning
	it to the left or right button brush according to which button you
	sample it with.


Gradient
	Creates a linear or radial gradient from the mouse press location to
	the mouse release location, starting with the colour of the first
	button pressed. It uses the left and right button colours and opacity.


Create Brush
	Creates new vertices at the mouse position when pressing the left mouse
	button. Dragging the mouse results in a line of vertices, separated by
	the brush radius. Holding shift while doing so will rearrange the
	triangles near the brush to avoid sharp angles as far as possible.


Edge Flip
	Where two triangles form a quad, the edge separating them will flip
	around to to stretch from the two other opposing corners when clicked on
	with the left mouse button.


Triangle fill
	Creates a triangle between three vertices manually selected while
	holding the left mouse button. Following triangles connect to the two
	last selected vertices.


Triangle Autofill Brush
	Automatically filles triangles between vertices found within the brush
	radius, but without regard to tidiness. Warning: It lags considerably
	when too many vertices or triangles are under the brush.


Beautify Brush
	Rearranges the triangle mapping near the brush by flipping edges to
	reduce the number of sharp angles. This creates a more uniform and
	orderly wireframe. It can solve quite messy cases of overlapping
	triangles, though in too extreme cases it will fail.


Delete Brush
	Deletes all geometry touching the brush - unless you hold shift, in which
	case vertices will not be erased.


Edge Collapse
	Collapses the left-clicked edge into a single vertex at the mouse position.
	The new vertex' colour is mixed from the two edge endpoints, but with 
	more weight to the nearest vertex. The new vertex can be repositioned until
	you release the mouse button.


Grab Brush
	Drags vertices inside the brush radius along with the mouse cursor, but
	it's hold fades outwards towards the brush outline. Can be used to deform
	and manipulate the geometry or simply to position individual vertices.


Select or Transform: Move
	Select vertices with the right mouse button. Additively by holding Shift,
	or subtractively by holding Ctrl. 
	With the left mouse button, selected vertices are moved uniformly along
	with the mouse cursor, essentially rotating the selection around the
	sphere's center.
	Holding shift while moving will make the vertices move linearly along
	that axis but snap back to the sphere surface.


Select or Transform: Rotate
	Select vertices with the right mouse button. Additively by holding Shift,
	or subtractively by holding Ctrl. With the left mouse button, the selection
	is rotated around the center of the screen.


Select or Transform: Scale
	Select vertices with the right mouse button. Additively by holding Shift,
	or subtractively by holding Ctrl.
	With the left mouse button, the selection is scaled around the center of
	the screen. Holding shift limits the scaling to a single axis.


Pipette select
	Selects vertices with a colour similar to the colour found where the left 
	mouse button is pressed. Additively by holding Shift, subtractively by
	holding Ctrl.


Selection Group Brush
	Assigns a group index to vertices. The group index is chosen by pressing
	the 0-9 digit keys on your keyboard. Outside this mode, vertices of the
	corresponding groups can be selected by pressing these keys.


Sketch Pencil
	Draw sketch lines with the left mouse button, erase them with the right
	mouse button.
